/**
 * 
 */
package com.sf.osms.dep.groovy

import com.sf.osms.dep.domain.Router
import java.util.List
import java.util.Map
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.regex.Pattern

/**
 * @author sfhq1405
 *
 */
public class AuPostEventCodeInfo implements GroovyInterface{

	private static Logger logger = LoggerFactory.getLogger("AuPostEventCodeInfo");
	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#hanleCorrectRoutersList(java.util.List)
	 */
	public void hanleCorrectRoutersList(List list){
		
	}
	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#handleSimgleOrginalRouter(java.util.Map)
	 */
	public void handleSimgleOrginalRouter(Map map){
	
		
	}
	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#handleSimgleRouter(com.sf.osms.dep.domain.Router)
	 */
	public void handleSimgleRouter(Router router){
		if(44 == router.eventCode && router.agentWaybill != null && !router.agentWaybill.equals("")) {
			router.netNum = "OSR01R";
		}
		
		if(80 == router.eventCode && router.phoneZone != null && router.phoneZone.length() >= 3){
			String str = router.phoneZone.substring(2,3);
			Pattern pattern = Pattern.compile("[0-9]*");
			boolean matches = pattern.matcher(str).matches();
			if(matches){
				router.eventCode = 70;
				router.reasonCode = 6;
				router.phoneZone = null;
				router.podStatus = null;
				router.podSendCount = null;
			}
		}
	}
	
	
}
